package io.elegant.sessions.widgets

import android.content.Context
import androidx.appcompat.widget.AppCompatRadioButton
import io.elegant.Elegant
import io.elegant.ElegantApiGrpc
import io.elegant.widgets.RadioWidget
import io.grpc.stub.StreamObserver
import kotlin.reflect.KClass

class WidgetRadioSession(
    stub: ElegantApiGrpc.ElegantApiStub,
    context: Context
): BaseWidgetSession<AppCompatRadioButton, RadioWidget<AppCompatRadioButton>>(stub, context) {
    override val clazz = AppCompatRadioButton::class
    @Suppress("UNCHECKED_CAST")
    override val widgetClazz = RadioWidget::class as KClass<RadioWidget<AppCompatRadioButton>>
    override val sendStreamObserver: StreamObserver<Elegant.Interaction> = stub.widgetRadio(receiveStreamObserver)

}